home *** CD-ROM | disk | FTP | other *** search
- Path: clients1.news.internex.net!usenet
- From: steve@icarus.icarus.com (Stephen Williams)
- Newsgroups: comp.lang.c++
- Subject: Re: Can somebody explain me how to do this in C++
- Date: 19 Apr 1996 18:28:42 -0700
- Organization: Picture Elements, Inc.
- Sender: steve@icarus.icarus.com
- Message-ID: <x720lj1y5x.fsf@icarus.icarus.com>
- References: <4hkb2o$ko3@mo6.rc.tudelft.nl> <4keb0h$d5e@bilbo.nask.org.pl>
- NNTP-Posting-Host: icarus.icarus.com
- In-reply-to: piotrpar@blue.maloka.waw.pl's message of Tue, 09 Apr 1996
- 18:45:40 GMT
- X-Newsreader: Gnus v5.1
-
-
- Try this:
-
- class Base {
- [...stuff...]
-
- };
-
- class D1 : public Base {
- [...stuff...]
- };
-
- class D2 : public Base {
- [...stuff...]
- };
-
- Notice that the Base class is a PUBLIC base class, so
-
- D1 bar;
- Base *foo = &bar;
-
- works fine without any casting. It is best to avoid explicit
- casts. They are evil.
-
- --
- Steve Williams Fight License Managers!
- steve@icarus.com Buy from vendors who use
- steve@picturel.com Honor system licensing!
-